package com.atguigu.gmall.publisherlj.service.impl;

import com.atguigu.gmall.publisherlj.bean.TradeStats;
import com.atguigu.gmall.publisherlj.mapper.TradeProvinceMapper;
import com.atguigu.gmall.publisherlj.mapper.TradeStatisticsMapper;
import com.atguigu.gmall.publisherlj.service.TradeStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.*;

/**
 * @Author 晶晶  service实现类负责加工数据 1.先从mapper端获取数据
 * @Date 2023 03 29 15 24
 **/

@Service
public class TradeStatsServiceImpl implements TradeStatsService {

    @Autowired
    private TradeProvinceMapper tradeProvinceMapper;

    @Autowired
    private TradeStatisticsMapper tradeStatisticsMapper;

    @Override
    public List<Map> getTradeProvinceOrderCt(int date) {
       return tradeProvinceMapper.selectTradeOrderCnt(date);
    }

    @Override
    public BigDecimal getOrderAmount(int date) {
        return tradeStatisticsMapper.selectOrderAmount(date);
    }


    @Override
    public List<TradeStats> getTradeStats(int date) {
        return tradeStatisticsMapper.selectTradeStats(date);
    }
}
